<?
$page_title="Event Registration ";
$mindex=3;
?>
<? include("includes/header.php") ?>
<?
$event_info=@array_pop(qry_data("select * from bkit_news where rec_status>=1 and news_id=".$_GET["event_id"]));
?>
<div class="break"></div>
<b>Event Information :</b>
<?if($_GET["mode"]==1) { ?>
<div class="msgBox">You have successfully registered for the following event.<p> You will be notified once the registration is confirmed.</p></div>
<? } ?>
<pre class="event_info">
Name : <?=$event_info["news_title"]?><br/>
Date : <?=$event_info["news_date"]?><br/>
Event City : <?=$event_info["event_city"]?><br/>
Address & Location : <br/><?=$event_info["event_address"]?><br/>
</pre>

<?if($_GET["mode"]!=1) { ?>
<script src="registrant.js?v7" language="javascript"></script>
<script src="calendarDateInput.js" language="javascript"></script>
<script src="prototype.js" language="javascript"></script>


<form action="event_register_pro.php?event_id=<?=$_GET["event_id"]?>" method="post" id="frmRegister" onsubmit="return validateForm(this)" >
<div class="fright"><i>* Required fields</i></div>
<div class="break"></div>
  <table id="Regform" border="0" cellspacing="3" cellpadding="2" >

    <tbody>
	<tr><td colspan="2" class="section_head">Personal Information</td></tr>
      <tr>

        <td class="frmLabel">Full Name&nbsp;*</td>

        <td>
        

          <input class="txtbox" name="full_name" id="full_name" size="40" value="" type="text" />
        

        </td>

      </tr>
  <tr>

        <td class="frmLabel">Gender &nbsp;*</td>

        <td>
        

          <input class="inputCheckbox" name="gender" id="rbGender_Male" value="1" type="radio" />
	<label for="rbGender_Male">Male</label>
          <input class="inputCheckbox" name="gender" id="rbGender_Female" value="2" type="radio" />
	<label for="rbGender_Female">Female</label>
        

        </td>

      </tr>
     <!-- <tr>

        <td class="frmLabel">Date of
Birth &nbsp;</td>

        <td>
 
 <script language="javascript">DateInput('dob', false, 'YYYY-MM-DD');</script>

        </td>

      </tr>-->
      

	
	<tr><td  class="frmLabel" valign="top">Mailing /Contact Address&nbsp;</td><td><textarea class="txtarea" name="contact_address" id="contact_address" rows="4" cols="50"></textarea></td></tr>
	<tr><td class="frmLabel">City </td><td><input type="text" name="reg_city" value="" class="txtbox"></td></tr>
	<tr><td class="frmLabel">State </td><td><?=createSelect("reg_state", $states,  $selected = $member["reg_state"]==""?"":$member["reg_state"],"onchange=setState(this.value)")?>&nbsp;<input style="display:none" name="reg_state_other" id="reg_state_other" size="15" value="<?=$member["reg_state"];?>"  type="text" class="txtbox"	 /></td></tr>
	<tr><td class="frmLabel">Country</td><td><?=createSelect("reg_country", $countries,  $selected = $member["reg_country"]==""?"IN":$member["reg_country"],"onchange=setCountry(this.value)")?>&nbsp;<input style="display:none" name="reg_country_other" id="reg_country_other" size="15" value="<?=$member["reg_country"];?>"  type="text" class="txtbox"	 /></td></tr></td></tr>

 <tr>
       <td class="frmLabel">Pin Code&nbsp;</td>
        <td>
              <input class="txtbox" name="reg_zip" id="reg_zip" size="6"  maxlength="6" value="" type="text" onkeypress="return allowNumbersOnly(event)"	/>
         </td>
</tr>



	<tr><td colspan="2" class="section_head">Contact Information</td></tr>
	<tr>

        <td class="frmLabel">Email
address&nbsp; *</td>

        <td>
        

          <input name="reg_email" id="reg_email" size="25" value=""  type="text"  class="txtbox"/>
        

        </td>

      </tr>
      <tr><td class="frmLabel">Telephone No (inc STD code)&nbsp;</td>
        <td><input class="txtbox" name="reg_phone" id="reg_phone" size="25" value=""  type="text" onkeypress="return allowNumbersOnly(event)"	/></td>
     </tr>
      <tr>

        <td class="frmLabel">Cell
phone / Mobile No</td>

        <td>
        

          <input name="reg_mobile" class="txtbox" id="reg_mobile" size="25" value=""  type="text" onkeypress="return allowNumbersOnly(event)"	/>
        

        </td>

      </tr>

      

     	
      <tr>

        <td class="frmLabel" valign="top" colspan="2"><br/> Any other information you would like to share :
	<br/>
   <textarea class="txtarea" name="reg_notes" id="reg_notes" rows="4" cols="60"></textarea>

	</td>

      </tr>

    </tbody>
  </table>

&nbsp;
  <p align="center"><input value=" Register for this Event " id="frmSubmit" name="submit" type="submit" class="button"/>  <input value=" Reset " name="reset" type="reset"  class="button"/></p>

</form>
<? } ?>

<script type="text/javascript">
function validateForm(vFormObject){


	var validateEmail=true;
	var validatePhone=false;

	var msgPrefix=" ";
	var user_msg="";
	var emailfilter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

	if(vFormObject.full_name.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Full Name cannot be empty. Please check.");
	

	if(vFormObject.rbGender_Male.checked==false && vFormObject.rbGender_Female.checked==false)
		user_msg= user_msg + wrap("Please select the gender Male or Female.");
	
		
	/*if(vFormObject.contact_address.value=="")
		user_msg= user_msg + wrap(msgPrefix + "Mailing/Contact Address cannot be empty. Please check.");
	if(vFormObject.reg_city.value=="")
		user_msg= user_msg + wrap(msgPrefix + "City cannot be empty. Please check.");
		
	if(vFormObject.reg_state.value=="")
		user_msg= user_msg + wrap(msgPrefix + "State cannot be empty. Please check.");
	*/
		
	if(vFormObject.reg_phone.value=="" && vFormObject.reg_mobile.value=="")
		user_msg = user_msg + wrap(msgPrefix + "Please enter either Landline Phone Number or Mobile Phone No.");

	if(vFormObject.reg_email.value=="" && validateEmail==true)		
		user_msg = user_msg + wrap("Email address cannot be empty. Please check.");
	

	if(vFormObject.reg_email.value!="")
	{
	
		if (!emailfilter.test(vFormObject.reg_email.value)){
		
		user_msg = user_msg + wrap("Invalid Email address. Please check.");
		
		}
	}
	

	if(user_msg=="")
	{		
		return true;
	}
	else
	{	
		alert(user_msg);
		return false;
	}

	

}





</script>
<? include("includes/footer.php") ?>